<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>页面刷新</title>
</head>
<body>
    <img  id="randomImg" src="/study-js/课外练习/static/images/pro-1.jpg" alt="随机显示的图片" >
    <script>
        const listimgs = ['pro-1.jpg',
        'pro-2.jpg',
        'pro-3.jpg'
    ]
        const imgIndex =Math.floor(Math.random() *listimgs.length)
        const images = document.getElementById("randomImg")
        images.src = listimgs[imgIndex]
    </script>
</body>
</html>